﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BeatlesBlog.SimConnect;
using FA.Library.Sim.Aircraft;
using FA.Library.Util;
using System.ComponentModel;

namespace FA.Plugins.FSXPlugin.Sim.Aircraft
{
    [DataStruct()]
    public class FSXAircraftFuel : BaseCloneable, AircraftFuel
    {
        public event PropertyChangedEventHandler PropertyChanged;

        /// <summary>
        /// Percentage of fuel in center tank.
        /// </summary>
        [DataItem("FUEL TANK CENTER LEVEL", "percent")]
        public float FuelLevelCenter
        {
            get { return _fuelLevelCenter; }
            set
            {
                if (_fuelLevelCenter != value)
                {
                    _fuelLevelCenter = value;
                    if (PropertyChanged != null)
                        PropertyChanged(this, new PropertyChangedEventArgs("FuelLevelCenter"));
                }
            }
        }
        private float _fuelLevelCenter;

        /// <summary>
        /// Percentage of fuel in left tank.
        /// </summary>
        [DataItem("FUEL TANK LEFT MAIN LEVEL", "percent")]
        public float FuelLevelLeftMain
        {
            get { return _fuelLevelLeftMain; }
            set
            {
                if (_fuelLevelLeftMain != value)
                {
                    _fuelLevelLeftMain = value;
                    if (PropertyChanged != null)
                        PropertyChanged(this, new PropertyChangedEventArgs("FuelLevelLeftMain"));
                }
            }
        }
        private float _fuelLevelLeftMain;

        /// <summary>
        /// Percentage of fuel in right tank.
        /// </summary>
        [DataItem("FUEL TANK RIGHT MAIN LEVEL", "percent")]
        public float FuelLevelRightMain
        {
            get { return _fuelLevelRightMain; }
            set
            {
                if (_fuelLevelRightMain != value)
                {
                    _fuelLevelRightMain = value;
                    if (PropertyChanged != null)
                        PropertyChanged(this, new PropertyChangedEventArgs("FuelCapacityCenter"));
                }
            }
        }
        private float _fuelLevelRightMain;

        /// <summary>
        /// Capacity of fuel in center tank.
        /// </summary>
        [DataItem("FUEL TANK CENTER CAPACITY", "gallons")]
        public int FuelCapacityCenter
        {
            get { return _fuelCapacityCenter; }
            private set
            {
                if (_fuelCapacityCenter != value)
                {
                    _fuelCapacityCenter = value;
                    if (PropertyChanged != null)
                        PropertyChanged(this, new PropertyChangedEventArgs("FuelCapacityCenter"));
                }
            }
        }
        private int _fuelCapacityCenter;

        /// <summary>
        /// Capacity of fuel in left tank.
        /// </summary>
        [DataItem("FUEL TANK LEFT MAIN CAPACITY", "gallons")]
        public int FuelCapacityLeftMain
        {
            get { return _fuelCapacityLeftMain; }
            private set
            {
                if (_fuelCapacityLeftMain != value)
                {
                    _fuelCapacityLeftMain = value;
                    if (PropertyChanged != null)
                        PropertyChanged(this, new PropertyChangedEventArgs("FuelCapacityLeftMain"));
                }
            }
        }
        private int _fuelCapacityLeftMain;

        /// <summary>
        /// Capacity of fuel in right tank.
        /// </summary>
        [DataItem("FUEL TANK RIGHT MAIN CAPACITY", "gallons")]
        public int FuelCapacityRightMain
        {
            get { return _fuelCapacityRightMain; }
            private set
            {
                if (_fuelCapacityRightMain != value)
                {
                    _fuelCapacityRightMain = value;
                    if (PropertyChanged != null)
                        PropertyChanged(this, new PropertyChangedEventArgs("FuelCapacityRightMain"));
                }
            }
        }
        private int _fuelCapacityRightMain;
    }
}